import request from '@/utils/request';

// 2.2.1.2 新增项目接口
export const projectAdd = async (data: any, options?: API.baseOption) =>
  request('/codemuse_api/codemuse/project/add', {
    method: 'POST',
    data,
    ...(options || {}),
  });

//2.2.1.4 项目列表查询接口
export const projectList = async (data: any, options?: API.baseOption) =>
  request('/codemuse_api/codemuse/project/list', {
    method: 'GET',
    data,
    ...(options || {}),
  });

//2.2.2.6 根据项目查询需求列表
export const findDemand = async (id: any, options?: API.baseOption) =>
  request(`/codemuse_api/codemuse/requirement/project/${id}`, {
    method: 'GET',
    ...(options || {}),
  });

// 2.2.1.2 新增需求
export const requirementAdd = async (data: any, options?: API.baseOption) =>
  request('/codemuse_api/codemuse/requirement/add', {
    method: 'POST',
    data,
    ...(options || {}),
  });

// 2.2.1.7 项目成员列表
export const findMembers = async (id: any, options?: API.baseOption) =>
  request(`/codemuse_api/codemuse/project-members/project/${id}`, {
    method: 'GET',
    ...(options || {}),
  });

// 2.2.1.2 新增项目接口
export const projectAddBro = async (data: any, options?: API.baseOption) =>
  request('/codemuse_api/codemuse/project/add', {
    method: 'POST',
    data,
    ...(options || {}),
  });

// 2.2.1.3 项目详情查询接口
export const projectDetail = async (data: any, options?: API.baseOption) =>
  request(`/codemuse_api/codemuse/project/detail/${data}`, {
    method: 'GET',
    data,
    ...(options || {}),
  });

// 2.2.1.4 项目列表查询接口
export const projectListBro = async (data: any, options?: API.baseOption) =>
  request(`/codemuse_api/codemuse_api/codemuse/project/list`, {
    method: 'GET',
    data,
    ...(options || {}),
  });

// 2.2.1.5 更新项目信息
export const projectUpdate = async (data: any, options?: API.baseOption) =>
  request(`/codemuse_api/codemuse/project/update`, {
    method: 'PUT',
    data,
    ...(options || {}),
  });

// 2.2.1.6 删除项目
export const projectDelete = async (data: any, options?: API.baseOption) =>
  request(`/codemuse_api/codemuse/project/delete/${data}`, {
    method: 'DELETE',
    data,
    ...(options || {}),
  });

// 2.2.1.7 项目成员列表
export const membersProject = async (data: any, options?: API.baseOption) =>
  request(`/codemuse_api/codemuse/project-members/project/${data.projectId}`, {
    method: 'GET',
    data,
    ...(options || {}),
  });

// 2.2.1.8 新增项目成员
export const projectMembersAdd = async (data: any, options?: API.baseOption) =>
  request(`/codemuse_api/codemuse/project-members/add`, {
    method: 'POST',
    data,
    ...(options || {}),
  });

// 2.2.1.9 删除项目成员
export const projectMembersDelete = async (
  data: any,
  options?: API.baseOption,
) =>
  request(`/codemuse_api/codemuse/project-members/delete/${data}`, {
    method: 'DELETE',
    data,
    ...(options || {}),
  });

// 2.2.1.10 修改项目成员
export const projectMembersUpdate = async (
  data: any,
  options?: API.baseOption,
) =>
  request(`/codemuse_api/codemuse/project-members/update`, {
    method: 'PUT',
    data,
    ...(options || {}),
  });

// 2.2.2 需求管理

// 2.2.2.2 新增需求
export const requirementAddBro = async (data: any, options?: API.baseOption) =>
  request(`/codemuse_api/codemuse/requirement/add`, {
    method: 'POST',
    data,
    ...(options || {}),
  });

// 2.2.2.3 修改需求
export const requirementUpdate = async (data: any, options?: API.baseOption) =>
  request(`/codemuse_api/codemuse/requirement/update/${data}`, {
    method: 'PUT',
    data,
    ...(options || {}),
  });

// 2.2.2.4 删除需求
export const requirementDelete = async (data: any, options?: API.baseOption) =>
  request(`/codemuse_api/codemuse/requirement/delete/${data}`, {
    method: 'DELETE',
    data,
    ...(options || {}),
  });

// 2.2.2.5 需求明细
export const requirementDetail = async (data: any, options?: API.baseOption) =>
  request(`/codemuse_api/codemuse/requirement/detail/${data}`, {
    method: 'GET',
    data,
    ...(options || {}),
  });

// 2.2.2.6 根据项目查询需求列表
export const requirementProject = async (data: any, options?: API.baseOption) =>
  request(`/codemuse_api/codemuse/requirement/project/${data}`, {
    method: 'GET',
    // data,
    ...(options || {}),
  });

//   2.2.4.3 创建会话
export const conversationAdd = async (data: any, options?: API.baseOption) =>
  request(`/codemuse_api/codemuse/conversation/add`, {
    method: 'POST',
    data,
    ...(options || {}),
  });
//   2.2.4.3 创建会话
export const codemuseUsers = async (data: any, options?: API.baseOption) =>
  request(`/codemuse_api/codemuse/users`, {
    method: 'GET',
    data,
    ...(options || {}),
  });
//  2.2.4.2 查询未关联会话
export const listNotRefer = async (data?: any, options?: API.baseOption) =>
  request(`/codemuse_api/codemuse/conversation/listNotRefer`, {
    method: 'GET',
    data,
    ...(options || {}),
  });
//  2.2.4.2 查询未关联会话
export const conversationUpdate = async (
  data?: any,
  options?: API.baseOption,
) =>
  request(`/codemuse_api/codemuse/conversation/update`, {
    method: 'PUT',
    data,
    ...(options || {}),
  });
